package org.example.service.impl;

import org.apache.ibatis.session.SqlSessionFactory;
import org.example.mapper.DoorMapper;
import org.example.pojo.Door;
import org.example.service.DoorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DoorServiceImpl implements DoorService {

    @Autowired
    private SqlSessionFactory sqlSessionFactory;

    @Autowired
    private DoorMapper doorMapper;
    @Override
    public List<Door> getAllDoor() {
        return doorMapper.getAllDoor();
    }

    @Override
    public void addDoor(Door door) {
        doorMapper.addDoor(door);
    }

    @Override
    public void update(Door door) {
        doorMapper.update(door);
    }

    @Override
    public Door getDoor(Integer id) {
        return doorMapper.getDoor(id);
    }

    @Override
    public void deleteDoor(Integer id) {
        doorMapper.deleteDoor(id);
    }
}
